\(\int \frac {\csc ^2(x)}{i+\tan (x)} \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 18 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=i x+i \cot (x)+\log (\cos (x))+\log (\tan (x)) \]

[Out]

I*x+I*cot(x)+ln(cos(x))+ln(tan(x))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3597, 46} \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=i x+i \cot (x)+\log (\tan (x))+\log (\cos (x)) \]

[In]

Int[Csc[x]^2/(I + Tan[x]),x]

[Out]

I*x + I*Cot[x] + Log[Cos[x]] + Log[Tan[x]]

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{x^2 (i+x)} \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \left (\frac {1}{-i-x}-\frac {i}{x^2}+\frac {1}{x}\right ) \, dx,x,\tan (x)\right ) \\ & = i x+i \cot (x)+\log (\cos (x))+\log (\tan (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.83 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=i x+i \cot (x)+\log (\sin (x)) \]

[In]

Integrate[Csc[x]^2/(I + Tan[x]),x]

[Out]

I*x + I*Cot[x] + Log[Sin[x]]

Maple [A] (verified)

Time = 2.97 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.11

method result size
default \(\ln \left (\tan \left (x \right )\right )+\frac {i}{\tan \left (x \right )}-\ln \left (i+\tan \left (x \right )\right )\) \(20\)
risch \(-\frac {2}{{\mathrm e}^{2 i x}-1}+\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(21\)

[In]

int(csc(x)^2/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

ln(tan(x))+I/tan(x)-ln(I+tan(x))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.39 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=\frac {{\left (e^{\left (2 i \, x\right )} - 1\right )} \log \left (e^{\left (2 i \, x\right )} - 1\right ) - 2}{e^{\left (2 i \, x\right )} - 1} \]

[In]

integrate(csc(x)^2/(I+tan(x)),x, algorithm="fricas")

[Out]

((e^(2*I*x) - 1)*log(e^(2*I*x) - 1) - 2)/(e^(2*I*x) - 1)

Sympy [F]

\[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=\int \frac {\csc ^{2}{\left (x \right )}}{\tan {\left (x \right )} + i}\, dx \]

[In]

integrate(csc(x)**2/(I+tan(x)),x)

[Out]

Integral(csc(x)**2/(tan(x) + I), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.94 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=\frac {i}{\tan \left (x\right )} - \log \left (\tan \left (x\right ) + i\right ) + \log \left (\tan \left (x\right )\right ) \]

[In]

integrate(csc(x)^2/(I+tan(x)),x, algorithm="maxima")

[Out]

I/tan(x) - log(tan(x) + I) + log(tan(x))

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=\frac {i}{\tan \left (x\right )} - \log \left (\tan \left (x\right ) + i\right ) + \log \left ({\left | \tan \left (x\right ) \right |}\right ) \]

[In]

integrate(csc(x)^2/(I+tan(x)),x, algorithm="giac")

[Out]

I/tan(x) - log(tan(x) + I) + log(abs(tan(x)))

Mupad [B] (verification not implemented)

Time = 4.67 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int \frac {\csc ^2(x)}{i+\tan (x)} \, dx=\mathrm {atan}\left (2\,\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )\,2{}\mathrm {i}+\frac {1{}\mathrm {i}}{\mathrm {tan}\left (x\right )} \]

[In]

int(1/(sin(x)^2*(tan(x) + 1i)),x)

[Out]

atan(2*tan(x) + 1i)*2i + 1i/tan(x)